<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
  <head>
    <title>ecastmyhome.com :: Administration</title>
    <script type="text/javascript" src="jquery.js"></script>
    <script type="text/javascript" src="thickbox.js"></script>
    <link href="../../css/index.css" rel="stylesheet" type="text/css" media="all" />
    <link href="thickbox.css" rel="stylesheet" type="text/css" media="all" />
     <?php
       session_start();
       include_once ('/home/ecastmyhome/functions.php');
       CheckLogin("yes");
     ?>
  </head>
  <body>
    <div align="left">
<?php


function yearView()
{

///// ---------- put entire function into foreach loop, after a statement
// that gets all the table names for all years. the foreach will
// iterate through all the different tables and there for years


  dbconntest();
  $jantt = 0;
  $febtt = 0;
  $martt = 0;
  $aprtt = 0;
  $maytt = 0;
  $juntt = 0;
  $jultt = 0;
  $augtt = 0;
  $septt = 0;
  $octtt = 0;
  $novtt = 0;
  $dectt = 0;

  $totalErrorst = 0;

  $creationYear = 2009;
  $installDate = 2009;
  $thisYear = date(Y);

  $sql = "SELECT * FROM errorCodes";
  $errors = mysql_query($sql) or die 
  ("<div align=\"center\"><h4>COULD NOT RUN QUERY.<br /><sup>ERO.1000</sup>");

      ?>
      <table width=938px>
      <tr>
      <td width=67px align=left>Error</td>
      <td width=67px align=left>Jan</td>
      <td width=67px align=left>Feb</td>
      <td width=67px align=left>Mar</td>
      <td width=67px align=left>Apr</td>
      <td width=67px align=left>May</td>
      <td width=67px align=left>Jun</td>
      <td width=67px align=left>Jul</td>
      <td width=67px align=left>Aug</td>
      <td width=67px align=left>Sep</td>
      <td width=67px align=left>Oct</td>
      <td width=67px align=left>Nov</td>
      <td width=67px align=left>Dec</td>
      <td width=67px align=left>Total</td>
      </tr>
      </table>
      <?php   
  while ($row2 = mysql_fetch_assoc($errors))
  {
  $jant = 0;
  $febt = 0;
  $mart = 0;
  $aprt = 0;
  $mayt = 0;
  $junt = 0;
  $jult = 0;
  $augt = 0;
  $sept = 0;
  $octt = 0;
  $novt = 0;
  $dect = 0;
  $year = 0;

  $totalErrors = 0;
      $errorNumber = $row2['errorNumber'];
      $errorDescripion = $row2['errorDescripion'];
      $actionTaken = $row2['actionTaken'];
      $recommendedAction = $row2['recommendedAction'];
   
      $sql2 = "SELECT * FROM errorCodesNum";
      $errors2 = mysql_query($sql2) or die 
      ("<div align=\"center\"><h4>COULD NOT RUN QUERY.<br /><sup>ERO.1001</sup>");

      while ($row = mysql_fetch_assoc($errors2))
      {
        $errorNumber2 = $row['errorNumber'];
        $month        = $row['month'];
        $year         = $row['year'];
        $time         = $row['time'];
        $number       = $row['number'];

        if($errorNumber == $errorNumber2){    
        switch ($month){
          case 1:
            $jant += $number;
            break;
          case 2:
            $febt += $number;
            break;
          case 3:
            $mart += $number;
            break;
          case 4:
            $aprt += $number;
            break;
          case 5:
            $mayt += $number;
            break;
          case 6:
            $junt += $number;
            break;
          case 7:
            $jult += $number;
            break;
          case 8:
            $augt += $number;
            break;        
          case 9:
            $sept += $number;
            break;
          case 10:
            $octt += $number;
            break;        
          case 11:
            $novt += $number;
            break;
          case 12:
            $dect += $number;
            break;  
        }
       $totalErrors += $number;
      }}
    

      echo "<table width=938px><tr><td width=67px align=left>";
      echo "<a href=\"#TB_inline?height=155&amp;width=300&amp;inlineId=$errorNumber&amp;modal=true\" class=thickbox>$errorNumber</a></td><td width=67px align=left>";
      echo number_format($jant) . "</td><td width=67px align=left>";
      echo number_format($febt) . "</td><td width=67px align=left>";
      echo number_format($mart) . "</td><td width=67px align=left>";
      echo number_format($aprt) . "</td><td width=67px align=left>";
      echo number_format($mayt) . "</td><td width=67px align=left>";
      echo number_format($junt) . "</td><td width=67px align=left>";
      echo number_format($jult) . "</td><td width=67px align=left>";
      echo number_format($augt) . "</td><td width=67px align=left>";
      echo number_format($sept) . "</td><td width=67px align=left>";
      echo number_format($octt) . "</td><td width=67px align=left>";
      echo number_format($novt) . "</td><td width=67px align=left>";
      echo number_format($dect) . "</td><td width=67px align=left>";
      echo number_format($totalErrors) . "</td></tr></table>";
   }
   
      $sql2 = "SELECT * FROM errorCodesNum";
      $errors2 = mysql_query($sql2) or die 
      ("<div align=\"center\"><h4>COULD NOT RUN QUERY.<br /><sup>ERO.1001</sup>");
   
      while ($row = mysql_fetch_assoc($errors2))
      {
        $errorNumber2 = $row['errorNumber'];
        $month        = $row['month'];
        $year         = $row['year'];
        $time         = $row['time'];
        $number       = $row['number'];

        switch ($month){
          case 1:
            $jantt += $number;
            break;
          case 2:
            $febtt += $number;
            break;
          case 3:
            $martt += $number;
            break;
          case 4:
            $aprtt += $number;
            break;
          case 5:
            $maytt += $number;
            break;
          case 6:
            $juntt += $number;
            break;
          case 7:
            $jultt += $number;
            break;
          case 8:
            $augtt += $number;
            break;        
          case 9:
            $septt += $number;
            break;
          case 10:
            $octtt += $number;
            break;        
          case 11:
            $novtt += $number;
            break;
          case 12:
            $dectt += $number;
            break;  
        }
       $totalErrorst += $number;
       }
       
      echo "<i><table width=938px><tr><td width=67px align=left>";
      echo "Totals</td><td width=67px align=left>";
      echo number_format($jantt) . "</td><td width=67px align=left>";
      echo number_format($febtt) . "</td><td width=67px align=left>";
      echo number_format($martt) . "</td><td width=67px align=left>";
      echo number_format($aprtt) . "</td><td width=67px align=left>";
      echo number_format($maytt) . "</td><td width=67px align=left>";
      echo number_format($juntt) . "</td><td width=67px align=left>";
      echo number_format($jultt) . "</td><td width=67px align=left>";
      echo number_format($augtt) . "</td><td width=67px align=left>";
      echo number_format($septt) . "</td><td width=67px align=left>";
      echo number_format($octtt) . "</td><td width=67px align=left>";
      echo number_format($novtt) . "</td><td width=67px align=left>";
      echo number_format($dectt) . "</td><td width=67px align=left>";
      echo number_format($totalErrorst) . "</td></tr></table></i>";   
}


?>

    <i><h3>View by Year</h3></i>
    <h4>2009</h4>
    <?php yearView(); ?>
    <br><br>
    <i><h3>View by Month</h3></i>
    <br><br>
    <i><h3>View by Day</h3></i>
    <br>
  </div>

<div id="1800" style="display:none"> 
<p>Connection Refused</p>
<p style="text-align:center"><input type="submit" id="Login" value="&nbsp;&nbsp;Ok&nbsp;&nbsp;" onclick="tb_remove()" /></p> 
</div>
<div id="1801" style="display:none"> 
<p>Operation Timed Out</p> 
<p style="text-align:center"><input type="submit" id="Login" value="&nbsp;&nbsp;Ok&nbsp;&nbsp;" onclick="tb_remove()" /></p> 
</div> 
<div id="1802" style="display:none"> 
<p>451 Temporary local problem - please try later</p> 
<p style="text-align:center"><input type="submit" id="Login" value="&nbsp;&nbsp;Ok&nbsp;&nbsp;" onclick="tb_remove()" /></p> 
</div> 
<div id="1803" style="display:none"> 
<p>Permission Denied</p> 
<p style="text-align:center"><input type="submit" id="Login" value="&nbsp;&nbsp;Ok&nbsp;&nbsp;" onclick="tb_remove()" /></p> 
</div> 
<div id="1804" style="display:none"> 
<p>Assign Requested Address</p> 
<p style="text-align:center"><input type="submit" id="Login" value="&nbsp;&nbsp;Ok&nbsp;&nbsp;" onclick="tb_remove()" /></p> 
</div> 
<div id="1805" style="display:none"> 
<p>Refused to talk to me Verizon Anti Spam</p> 
<p style="text-align:center"><input type="submit" id="Login" value="&nbsp;&nbsp;Ok&nbsp;&nbsp;" onclick="tb_remove()" /></p> 
</div> 
<div id="1806" style="display:none"> 
<p>Host or domain name not found. Name service error.</p> 
<p style="text-align:center"><input type="submit" id="Login" value="&nbsp;&nbsp;Ok&nbsp;&nbsp;" onclick="tb_remove()" /></p> 
</div> 
<div id="1807" style="display:none"> 
<p>421 opendir failed</p>
<p style="text-align:center"><input type="submit" id="Login" value="&nbsp;&nbsp;Ok&nbsp;&nbsp;" onclick="tb_remove()" /></p> 
</div> 
<div id="1808" style="display:none"> 
<p>Refused to talk to me: 421 Temporarily deferred due to user complaints.</p> 
<p style="text-align:center"><input type="submit" id="Login" value="&nbsp;&nbsp;Ok&nbsp;&nbsp;" onclick="tb_remove()" /></p> 
</div> 

 </body>
</html>